<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

class GiftLevel extends BaseModel
{
    protected $table = 'gift_level';
    public $timestamps = false;
    protected $fillable = ['title', 'image', 'url', 'price_begin', 'price_end', 'show'];
    private $fields = ['title', 'image', 'url', 'price_begin', 'price_end', 'show'];
    protected $attributes = [
        'is_show' => 1,
        'gift_sort' => 0
    ];
    protected $primaryKey = 'id';

    public function getlist(){
        $query = new self;
        $query = $query->where("is_delete", 0);
        return $query->get();
    }
    public function removeData($data){
        return curl_request(getKkaudioApiUrl() . '/inner/gift/level/del', $data, 'json', 'POST');
    }
    public function createOrUpdate($data){
        return curl_request(getKkaudioApiUrl() . '/inner/gift/level/createOrUpdate', $data, 'json', 'POST');
    }
}
